/******************************************************************************
* This file is part of is32p218 platform,
* Copyright (c) 2009 HangZhou InfoStrong CO.,LTD. All rights reserved.
* This software may only be used under the terms of a valid, current,
* end user license from InfoStrong.
* Nothing else gives you the right to use this software.   
*
* Name:   isOS.h
* Desc:   isOS header file
* Author: Jerry
* Date:   2009-9-16
* Note:   
* History:
*
******************************************************************************/
#ifndef __ISOS_H__
#define __ISOS_H__

//#include <stddef.h>
/* Type definitions. */
#define isOS_S8		char
#define isOS_U8		unsigned char
#define isOS_S16	short
#define isOS_U16	unsigned short
#define isOS_S32	int
#define isOS_U32	unsigned int
#define isOS_U64	unsigned long long
#define isOS_FLOAT	float
#define isOS_DOUBLE	double
#define isOS_STACK	isOS_U32
#define isOS_BOOL	isOS_S32

#ifndef isOS_BOOL
#define isOS_BOOL      isOS_S32
#endif

typedef isOS_U32 		isOS_TICK;

#undef	NULL
#define NULL 0                   /* see <stddef.h> */

typedef enum 
{
	NODE_ID_CR = 0,
	NODE_ID_EVT
}NODE_ID;

//-- Circular double-linked list queue
typedef struct _LIST_QUE
{
   struct _LIST_QUE * prev;
   struct _LIST_QUE * next;
}LIST_QUE;

/* Error definitions. */
#ifndef pdTRUE
#define pdTRUE      1
#endif

#ifndef pdFALSE
#define pdFALSE     0
#endif

//--- Types

#ifndef NULL
#define NULL      0
#endif


/*-----------------------------------------------------------
 * MACROS AND DEFINITIONS
 *----------------------------------------------------------*/

#define pdPASS					( 1 )
#define pdFAIL					( 0 )
  //-- Errors
#define  TERR_NO_ERR           1
#define  TERR_OVERFLOW       (-1)   //-- OOV
#define  TERR_WCONTEXT       (-2)   //-- Wrong context context error
#define  TERR_WSTATE         (-3)   //-- Wrong state   state error
#define  TERR_TIMEOUT        (-4)   //-- Polling failure or timeout
#define  TERR_WRONG_PARAM    (-5)	//-- Wrong parameters
#define  TERR_UNDERFLOW      (-6)
#define  TERR_OUT_OF_MEM     (-7)
#define  TERR_ILUSE          (-8)   //-- Illegal using
#define  TERR_NOEXS          (-9)   //-- Non-valid or Non-existent object
#define  TERR_DLT           (-10)   //-- Waiting object deleted

#define  OS_INVALID_VAL     0xFFFFFFFF


#endif /* __ISOS_H__ */



